<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Insert title here</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css"
	href="${ pageContext.request.contextPath }/js/css/bootstrap.css">
<script type="text/javascript"
	src="${ pageContext.request.contextPath }/js/js/jquery-1.11.1.js"></script>
<script type="text/javascript"
	src="${ pageContext.request.contextPath }/js/js/bootstrap.js"></script>
<style type="text/css">
table {
	text-align: center;
}

body {
	width: 80%;
	text-align: center;
	margin: 0 auto;
}

.error {
	border: 1px red dashed;
}
</style>
</head>
<br />
<br />
<body>
	<%@include file="/html/nav.html"%>
	<div class="col-xs-10 col-xs-offset-1">
		<div class="panel panel-primary" style="margin-top: 100px">
			<div class="panel-body">
				<table class="table table-bordered" border="1" id="tt">
						<h3>${weekDay}的课程 </h3>
					<tr>
						<th>课表名</th>
						<th>一次性</th>
						<th>上课时间</th>
						<th>下课时间</th>
						<th>授课老师</th>
						<th>授课积分</th>
						<th>创建日期</th>
						<th>备注</th>
						<th>操作</th>
					</tr>
					<c:forEach items="${bookList}" var="bookTables">
						<tr>
							<td>${bookTables.tableName}</td>
							<td>${bookTables.disposable}</td>
							<td>${bookTables.joinTime}</td>
							<td>${bookTables.exitTime}</td>
							<td>${bookTables.userss}</td>
							<td>${bookTables.integral}</td>
							<td>${bookTables.dateCreated}</td>
							<td>${bookTables.remarks}</td>
							<td>
	<!---  ---------------------------------------- 编辑模态框	--------------------------------------------- -->					
								<div class="modal" id="modalx${bookTables.id}">
									<div class="modal-dialog" style="width: 500px; margin-top: 150px">
										<div class="modal-content">
											<div class="modal-header" style="background-color: royalblue">
												编辑[ ${bookTables.tableName}]课表信息
											</div>
											<div class="modal-body">
												<form class="form-horizontal" method="post" action="/AAA/edit">
													<div class="form-group">
														<div class="col-xs-3 text-right">
															<label for="name" class="control-label">课表名</label>
														</div>
														<div class="input-group col-xs-8">
															<input id="name" name="tableName" class="form-control" required />
														</div>
													</div>
													<div class="form-group">
														<div class="col-xs-3 text-right">
															<label for="name" class="control-label">一次性</label>
														</div>
														<div class="input-group col-xs-8">
															<select class="col-xs-12 btn btn-default" style="height: 34px;" name="disposable">
																<option>是</option>
																<option>否</option>
															</select>
														</div>
													</div>
													<div class="form-group">
														<div class="col-xs-3 text-right">
															<label for="name" class="control-label">上课时间</label>
														</div>
														<div class="input-group col-xs-8">
															<input id="name" name="joinTime" class="form-control" required />
														</div>
													</div>
													<div class="form-group">
														<div class="col-xs-3 text-right">
															<label for="name" class="control-label">下课时间</label>
														</div>
														<div class="input-group col-xs-8">
															<input id="name" name="exitTime" class="form-control" required />
														</div>
													</div>
													<div class="form-group">
														<div class="col-xs-3 text-right">
															<label for="name" class="control-label">授课老师</label>
														</div>
														<div class="input-group col-xs-8">
															<input id="name" name="userName" class="form-control" required />
														</div>
													</div>
													<div class="form-group">
														<div class="col-xs-3 text-right">
															<label for="re_name" class="control-label">积分</label>
														</div>
														<div class="input-group col-xs-8">
															<input id="re_name" name="integral" class="form-control" required />
														</div>
													</div>
													<div class="form-group">
														<div class="col-xs-3 text-right">
															<label for="re_name" class="control-label">备注</label>
														</div>
														<div class="input-group col-xs-8">
															<input id="re_name" name="remarks" class="form-control" required />
														</div>
													</div>
												</form>
											</div>
											<div class="modal-footer">
												<a href="" class="btn btn-default" data-dismiss="modal">返回</a>
												<button id="registe" class="btn btn-primary">编辑</button>
											</div>
										</div>
									</div>
								</div> 
								<a class="btn btn-primary" data-toggle="modal"
								data-target="#modalx${bookTables.id} ">编辑</a>
<!---  ---------------------------------------- 删除模态框	--------------------------------------------- -->
								<div class="modal" id="modaly${bookTables.id}">
									<div class="modal-dialog"
										style="width: 500px; margin-top: 150px">
										<div class="modal-content">
											<div class="modal-header" style="background-color: royalblue">
												确定删除${bookTables.tableName}
											</div>
											<div class="modal-body">
												你确定要删除[ ${bookTables.tableName}]吗？
											</div>
										    <div class="modal-footer">
												<a href="/AAA/delete?delete=1&courseId=${bookTables.id}" class="btn btn-primary">1确认</a>
												<a href="" class="btn btn-default"  data-dismiss="modal">取消</a>
											</div>
										</div>
									</div>
								</div> 
								<a class="btn btn-primary" data-toggle="modal"
								data-target="#modaly${bookTables.id}">删除</a>
							</td>
						</tr>
					</c:forEach>
				</table>
				<a href="searChcourse?page=1">首页</a>&nbsp;&nbsp;
				<a href="searChcourse?page=${page-1}">上一页</a>&nbsp;&nbsp;
				<a href="searChcourse?page=${page+1}">下一页</a>&nbsp;&nbsp;
				<a href="#?page=0">末页</a>
			</div>
		</div>
	</div>


</body>
</html>
